<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .father {
        width: 500px;
        height: 500px;
        background: gray;
        /* 超出滚动 auto: 超出才显示滚动条，不超出就不显示， scroll: ⽆论溢出不溢出都会显示滚动条*/
        overflow: scroll;
      }
      .son {
        width: 500px;
        height: 500px;
        background: gold;
      }
    </style>
  </head>
  <body>
    <div class="father">
      <div class="son"></div>
    </div>
    <!-- 不占空间 -->
    <div style="display: none">ddd</div>
    <!-- 视觉隐藏，占空间 -->
    <div style="visibility: hidden">fff</div>
    <div>ggg</div>
  </body>
</html>
